<template>
    <div class="login">
        <el-form ref="form" :model="params" label-width="80px" class="login-list">
            <el-form-item label="用户名">
                <el-input v-model="params.userName"></el-input>
            </el-form-item>
            <el-form-item label="密码">
                <el-input v-model="params.password"></el-input>
            </el-form-item>
            <el-button type="primary" @click="onSubmit">登录</el-button>
        </el-form>
    </div>
</template>
<script>
  import LoginService from './../../service/Login-service'
  export default {
    data() {
      return {
        params: {
          userName:this.$util.getSessionStorage("userName") ||  '',
          password:this.$util.getSessionStorage("password") ||  '',
        }
      }
    },
    methods: {
      onSubmit() {
        this.$util.setSessionStorage('userName',this.params.userName);
        this.$util.setSessionStorage('password',this.params.password);
        LoginService.getPuCode(this.params.userName,this.params.password).then((data)=>{
            console.log(data)
          this.$router.push({
            path:'/app/module/waitCode'
          })
        })
      }
    }
  }
</script>
<style scoped lang="scss" type="text/scss">
    .login{
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        .login-list{
            width: 400px;
            height: 400px;
        }
    }
 </style>